﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Markup;

namespace ShopPowerTemplate.Common
{
    [ContentProperty(Name="Resources")]
    public class StringToObjectConverter : IValueConverter
    {
        private ResourceDictionary resources = new ResourceDictionary();
        public ResourceDictionary Resources
        {
            get { return this.resources; }
        }

        public object Convert(object value, Type targetType, object parameter, string language)
        {
            return resources[value.ToString()];
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }
}
